package com.lfd.datastructure.sort;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @项目名： spring-emq
 * @包名： com.lfd.datastructure.sort
 * @文件名: Student
 * @创建者: liufudong@szyh-smart.com
 * @创建时间: 2024/10/26 19:51
 * @描述：
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Student implements Comparable<Student> {
    private String name;
    private int age;

    @Override
    public int compareTo(Student student) {
        if (age > student.age) {
            return 1;
        }
        if (age < student.age) {
            return -1;
        }
        return 0;
    }
}
